home *** CD-ROM | disk | FTP | other *** search
/ HAM Radio 1997 / HAM Radio 1997.iso / vcls / date / tcom / ascopt.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1996-04-08  |  3.7 KB  |  148 lines

  1. {$G+,X+}
  2.  
  3. {Conditional defines that may affect this unit}
  4. {$I AWDEFINE.INC}
  5.  
  6. {*********************************************************}
  7. {*                   ASCOPT.PAS 1.01                     *}
  8. {*        Copyright (c) TurboPower Software 1995         *}
  9. {*                 All rights reserved.                  *}
  10. {*********************************************************}
  11.  
  12. unit Ascopt;
  13.  
  14. interface
  15.  
  16. uses
  17.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  18.   Forms, Dialogs, ExtCtrls, StdCtrls, Buttons, AdMisc, AdProtcl, TComIni;
  19.  
  20. type
  21.   TAsciiOptionsForm = class(TForm)
  22.     GroupBox1: TGroupBox;
  23.     ULCRHandlingBox: TRadioGroup;
  24.     ULLFHandlingBox: TRadioGroup;
  25.     GroupBox2: TGroupBox;
  26.     StopOnCtlZBox: TCheckBox;
  27.     Label1: TLabel;
  28.     EOLCharEdit: TEdit;
  29.     GroupBox3: TGroupBox;
  30.     Label2: TLabel;
  31.     DelayAfterCharEdit: TEdit;
  32.     Label3: TLabel;
  33.     DelayAfterLineEdit: TEdit;
  34.     GroupBox4: TGroupBox;
  35.     DLCRHandlingBox: TRadioGroup;
  36.     DLLFHandlingBox: TRadioGroup;
  37.     GroupBox5: TGroupBox;
  38.     Label4: TLabel;
  39.     EOFTimeoutEdit: TEdit;
  40.     OkBtn: TBitBtn;
  41.     CancelBtn: TBitBtn;
  42.     HelpBtn: TBitBtn;
  43.     procedure OkBtnClick(Sender: TObject);
  44.  
  45.   public
  46.     constructor Create(AOwner : TComponent); override;
  47.   end;
  48.  
  49. implementation
  50.  
  51. {$R *.DFM}
  52.  
  53. constructor TAsciiOptionsForm.Create(AOwner : TComponent);
  54. begin
  55.   inherited Create(AOwner);
  56.  
  57.   case UploadCR of
  58.     aetNone       : ULCRHandlingBox.ItemIndex := 0;
  59.     aetStrip      : ULCRHandlingBox.ItemIndex := 2;
  60.     aetAddCRBefore: ULCRHandlingBox.ItemIndex := 0;
  61.     aetAddLFAfter : ULCRHandlingBox.ItemIndex := 1;
  62.   end;
  63.  
  64.   case UploadLF of
  65.     aetNone       : ULLFHandlingBox.ItemIndex := 0;
  66.     aetStrip      : ULLFHandlingBox.ItemIndex := 2;
  67.     aetAddCRBefore: ULLFHandlingBox.ItemIndex := 1;
  68.     aetAddLFAfter : ULLFHandlingBox.ItemIndex := 0;
  69.   end;
  70.  
  71.   case DownloadCR of
  72.     aetNone       : DLCRHandlingBox.ItemIndex := 0;
  73.     aetStrip      : DLCRHandlingBox.ItemIndex := 2;
  74.     aetAddCRBefore: DLCRHandlingBox.ItemIndex := 0;
  75.     aetAddLFAfter : DLCRHandlingBox.ItemIndex := 1;
  76.   end;
  77.  
  78.   case DownloadLF of
  79.     aetNone       : DLLFHandlingBox.ItemIndex := 0;
  80.     aetStrip      : DLLFHandlingBox.ItemIndex := 2;
  81.     aetAddCRBefore: DLLFHandlingBox.ItemIndex := 1;
  82.     aetAddLFAfter : DLLFHandlingBox.ItemIndex := 0;
  83.   end;
  84.  
  85.   StopOnCtlZBox.Checked := StopCtrlZ;
  86.  
  87.   EOLCharEdit.Text := IntToStr(Byte(EolChar));
  88.  
  89.   DelayAfterCharEdit.Text := IntToStr(DelayChar);
  90.   DelayAfterLineEdit.Text := IntToStr(DelayLine);
  91.  
  92.   EOFTimeoutEdit.Text := IntToStr(AscTimeout);
  93. end;
  94.  
  95. procedure TAsciiOptionsForm.OkBtnClick(Sender: TObject);
  96. var
  97.   E : Integer;
  98.   W : Word;
  99.   B : Byte;
  100.  
  101. begin
  102.   {validate EOL character input}
  103.   Val(EOLCharEdit.Text, B, E);
  104.   if (E = 0) then
  105.     EolChar := Char(B);
  106.  
  107.   {validate inter-character delay input}
  108.   Val(DelayAfterCharEdit.Text, W, E);
  109.   if (E = 0) then
  110.     DelayChar := W;
  111.  
  112.   {validate inter-line delay input}
  113.   Val(DelayAfterLineEdit.Text, W, E);
  114.   if (E = 0) then
  115.     DelayLine := W;
  116.  
  117.   {validate end-of-file timeout message}
  118.  
  119.   case ULCRHandlingBox.ItemIndex of
  120.     0: UploadCR := aetNone;
  121.     1: UploadCR := aetAddLFAfter;
  122.     2: UploadCR := aetStrip;
  123.   end;
  124.  
  125.   case ULLFHandlingBox.ItemIndex of
  126.     0: UploadLF := aetNone;
  127.     1: UploadLF := aetAddCRBefore;
  128.     2: UploadLF := aetStrip;
  129.   end;
  130.  
  131.   case DLCRHandlingBox.ItemIndex of
  132.     0: DownloadCR := aetNone;
  133.     1: DownloadCR := aetAddLFAfter;
  134.     2: DownloadCR := aetStrip;
  135.   end;
  136.  
  137.   case DLLFHandlingBox.ItemIndex of
  138.     0: DownloadLF := aetNone;
  139.     1: DownloadLF := aetAddCRBefore;
  140.     2: DownloadLF := aetStrip;
  141.   end;
  142.  
  143.   StopCtrlZ := StopOnCtlZBox.Checked;
  144. end;
  145.  
  146. end.
  147.  
  148.